from distutils.core import setup, Extension


inline_all = False
define_macros = [
    ("_FILE_OFFSET_BITS", "64"),
    ("HTABLE_BOOST_GETS", None),
    #("HTABLE_COLLECT_STATS", None),
    ("TRACER_DUMP_ABSPATH", None),
]
sources = [
    "tracer/tracer.c",
    "tracer/_hptracer.c",
    "utils/reporting.c",
]

if inline_all:
    define_macros.extend([
        ("FMAP_INLINE_ALL", None),
        ("HPTIME_INLINE_ALL", None),
        ("HTABLE_INLINE_ALL", None),
        ("LISTFILE_INLINE_ALL", None),
        ("SWRITER_INLINE_ALL", None),
        ("TREEFILE_INLINE_ALL", None),
    ])
else:
    sources.extend([
        "utils/fmap.c",
        "utils/hptime.c",
        "utils/htable.c",
        "utils/listfile.c",
        "utils/swriter.c",
        "utils/treefile.c",
    ])

setup(
    name = "hptrace",
    version = "0.2",
    description = "high performane python tracer",
    py_modules = [
        'hptrace',
    ],
    ext_modules = [
        Extension("_hptrace",
            sources = sources,
            define_macros = define_macros,
            extra_compile_args = ["-Werror"], #, "-g", "-O0"],
        ),
    ],
    platforms = ["linux"],
    author = "tomer filiba",
    author_email = "tomerfiliba@gmail.com",
    url = "http://sebulbasvn.googlecode.com/svn/trunk/prace",
    long_description = "high performane python tracer",
)


